//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
    public static void main(String[] args) {
        System.out.println("黄猪乔是大傻逼");
    }
    //978.最长湍流子数组
    public int maxTurbulenceSize(int[] arr) {
        int n = arr.length;
        int[] f = new int[n];//以i位置为结尾的所有上升子数组，长度最长滴
        int[] g = new int[n];//下降子数组
        int ret = 1;
        f[0]=g[0]=1;
        for(int i=1;i<n;i++) {
            if(arr[i] > arr[i-1]) {
                f[i]=g[i-1]+1;
                g[i]=1;
            }else if(arr[i] < arr[i-1]) {
                f[i]=1;
                g[i]=f[i-1]+1;
            }else {
                f[i]=1;
                g[i]=1;
            }
            ret = Math.max(ret,Math.max(f[i],g[i]));
        }
        return ret;
    }

}